home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form FormMvt
- BackColor = &H00C0C0C0&
- Caption = "Movement"
- ClientHeight = 4710
- ClientLeft = 1830
- ClientTop = 1800
- ClientWidth = 7365
- Height = 5115
- Left = 1770
- LinkTopic = "Form1"
- ScaleHeight = 4710
- ScaleWidth = 7365
- Top = 1455
- Width = 7485
- Begin HiTimer HiTime1
- Interval = 100
- Left = 120
- Top = 120
- End
- Begin CommandButton CmdOk
- Caption = "Ok"
- Height = 495
- Left = 5880
- TabIndex = 1
- Top = 3960
- Width = 1335
- End
- Begin PictureBox PictureMvt
- Height = 3135
- Left = 840
- ScaleHeight = 3105
- ScaleWidth = 5625
- TabIndex = 0
- Top = 720
- Width = 5655
- End
- Begin Label Label2
- BackStyle = 0 'Transparent
- Caption = "This show you how the Object3D lib can be used to create fast movement. This example use the HiresTimer Vbx."
- Height = 615
- Left = 960
- TabIndex = 3
- Top = 3960
- Width = 4095
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "Movement....."
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 15
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 975
- Left = 840
- TabIndex = 2
- Top = 120
- Width = 5655
- End
- Option Explicit
- Dim ax As Integer
- Dim Pos3D As pt_3d
- Dim DemoObj As Long
- Dim DemoView As Long
- Dim numstep As Integer
- Sub CmdOk_Click ()
- Unload Me
- End Sub
- Sub Form_Load ()
- numstep = 0
- Show
- DemoObj = objet3d_create()
- DemoView = View3D_Create()
- Call View3D_Elem_Add(DemoView, DemoObj)
- Call view3d_setbuffer(DemoView, picturemvt.hWnd)
- Call View3D_Set(DemoView, K_ID_BACKGROUND, 7)
- End Sub
- Sub Form_Unload (Cancel As Integer)
- Call objet3d_delete(DemoObj)
- Call view3d_delete(DemoView)
- End Sub
- Sub HiTime1_Timer ()
- hitime1.Interval = 0
- Call Move_Obj
- hitime1.Interval = 50
- End Sub
- Sub Move_Obj ()
- Pos3D.x = 0
- Pos3D.y = -40
- Pos3D.z = 0
- ax = ax + 10
- If numstep = 0 Then
- Call Objet3D_LoadObj(DemoObj, ObjDir$ + "\hoover.m3d")
-
- Pos3D.x = 0
- Pos3D.y = 0
- Pos3D.z = 0
-
- Call Objet3D_Set(DemoObj, K_ID_FLG_SHADOW, CLng(0))
- Else
- If numstep >= 100 Then
- If numstep = 100 Then
- Call Objet3D_LoadObj(DemoObj, ObjDir$ + "\helico.m3d")
- Call Objet3D_Set(DemoObj, K_ID_FLG_SHADOW, CLng(1))
- End If
- Pos3D.x = 0
- Pos3D.y = 10 + 100 - 2 * (numstep - 100)
- If numstep >= 150 Then Pos3D.y = 10
- Pos3D.z = 0
-
- If numstep = 200 Then numstep = -1
- End If
- End If
- numstep = numstep + 1
- Call Objet3D_Set_Pos(DemoObj, Pos3D)
- Call objet3d_set_angles(DemoObj, 0, ax, 0)
- Call View3D_AffAll(DemoView)
- Call View3D_Switch(DemoView, picturemvt.hDC)
- End Sub
-